package com.rjj.wlqq.listen.myListen;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author renjianjun
 * @date 2020/8/14 14:17
 * @email 215060580@qq.com
 * 监听
 */
@Component
public class MyApplicationListen implements ApplicationListener<MyEvent> {

    @Override
    public void onApplicationEvent(MyEvent myEvent) {
        System.out.println(myEvent.getSource());
        myEvent.getMap().entrySet().stream().map(stringObjectEntry -> "map的数据：" + stringObjectEntry).forEach(System.out::println);
    }
}
